package jvm.stack;

/**
 * @Author: ideaAdmin
 * TODO: 栈的方法入栈出栈
 * Date: 2022/2/16:8:38
 * Description:
 */

public class StackCallMethod {
    public static void main(String[] args) {
        StackCallMethod stackCallMethod = new StackCallMethod();
        stackCallMethod.m1();
    }

    public void m1(){
        System.out.println("StackCallMethod.m1" + "在执行");
        try {
            int i = m2();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("StackCallMethod.m1" + "执行结束");
    }

    public int m2() {
        System.out.println("StackCallMethod.m2" + "开始执行");
        int i = (int) m3();
        System.out.println("StackCallMethod.m2" + "快结束了");
        return i;
    }

    public double m3() {
        System.out.println("StackCallMethod.m3" + "开始执行");
        double i = 20.0;
        int j = 1/0;
        System.out.println("StackCallMethod.m3" + "快结束了");
        return i;
    }


}
